import time
import unittest
from page.community_page import CommunityPage

class CommentTestCase(unittest.TestCase):
    @classmethod
    def setUpClass(cls) -> None:
        cls.community = CommunityPage(appPackage='com.nearme.gamecenter', appActivity='.ui.activity.SplashActivity')

    def test_01_comment(self):
        time.sleep(5)
        self.community.community_click()
        self.community.more_click()
        self.community.topic_click()
        time.sleep(5)
        self.community.screen_press()
        self.community.optReply_click()
        self.community.input_content("真好啊")
        self.community.submit_click()
        time.sleep(3)
        text = self.community.get_user_text()
        self.assertEqual("真好啊",text,msg="断言评论成功")

    @classmethod
    def tearDownClass(cls) -> None:
        cls.community.quit()

if __name__ == '__main__':
    unittest.main(verbosity=2)
